package com.Jhu1.controller;

import com.Jhu1.entity.Student;
import com.Jhu1.service.StudentService;
import com.Jhu1.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;
    @GetMapping("/list")
    public R findAll(){
        List<Student> list = studentService.list();
        return R.ok().data("list",list);
    }
}
